package com.ithm;

import java.util.Scanner;

public class Dl {
    public static void main(String[] args) {
        String username="admin";
        String password="admin";
        int a=0;
        while (true) {
            Scanner sc=new Scanner(System.in);
            System.out.println("请录入用户名");
            String name=sc.next();
            System.out.println("请录入密码");
            String pass=sc.next();

            if (username.equals(name) && password.equals(pass)) {
                System.out.println("恭喜你登录成功，可以玩猜数小游戏了");
                break;
            } else {
                a++;
                if (a==3){
                    break;
                }
                System.out.println("用户名或密码错误，请重新输入");
            }
        }

    }
}
